<template>
  <div>
    <div class="banner">
      <!-- <Tabs :activeIndex="activeIndex" @sendIndex="getIndex"></Tabs> -->
      <Header></Header>
      <!-- 路由占位符 -->
      <router-view></router-view>
    </div>
    <!-- 返回顶部 -->
    <el-backtop :bottom="100">
      <i class="iconfont icon-huidingbu"></i>
    </el-backtop>
    <Footer></Footer>
  </div>
</template>

<script>
import userUtils from '@/utils/userUtil'
// 导入底部组件
import Footer from '@/views/footer'
// import Tabs from '../../tabs'
import Header from '../../tabs/header'
export default {
  components: {
    Footer,
    // Tabs,
    Header
  },
  data () {
    return {
      activeIndex: 'exercise',
      isLogin: userUtils.isLogin()
    }
  },
  created () {
    this.getIndex()
  },
  methods: {
    getIndex(e){
      window.sessionStorage.setItem('activeIndex', e)
    },
    handleSelect (key, keyPath) {
      console.log(key, keyPath)
    },
    // 对 activeIndex 进行赋值
    saveNavActive (activeIndex) {
      window.sessionStorage.setItem('activeIndex', activeIndex)
      this.activeIndex = activeIndex
    }
  }
}
</script>

<style lang="less" scoped>
.banner {
  background-color: #fff;
}
header {
  position: absolute;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  height: 3.75rem;
  line-height: 3.75rem;
  font-size: 1.125rem !important;
  font-weight: bold;
  background-color: #fff;
  box-shadow: 0px 0.125rem 0.625rem 0px rgba(0, 0, 0, 0.09);
  z-index: 9999;
  .logo {
    flex: 0.7;
    text-align: center;
    line-height: 3.75rem;
  }
  .item {
    font-weight: bold;
    text-decoration: none;
    color: #666;
    padding: 0 1.25rem;
    display: inline-block;
    cursor: pointer;
    box-sizing: border-box;
  }
  a {
    text-decoration: none;
    box-sizing: border-box;
  }
}
.gap {
  background-color: #fff;
  height: 1.875rem;
}
.el-menu {
  background-color: transparent;
  color: #333333;
}
.el-menu-item.is-active {
  background-color: transparent !important;
}
.el-menu-item {
  background-color: rgba(0, 0, 0, 0) !important;
  font-size: 1.125rem;
}
.el-menu.el-menu--horizontal {
  border-bottom: none;
}
* {
  border-bottom-color: transparent !important;
}
.el-menu--horizontal > .el-menu-item {
  border-top: 0.125rem solid transparent;
  color: #333333;
}
.el-menu--horizontal > .el-menu-item.is-active {
  border-bottom: 0;
  border-top: 0.125rem solid rgb(255, 83, 66);
}
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
}
.username {
  display: inline-block;
  margin-left: 0.625rem;
  font-weight: bold;
  font-size: 1rem;
  color: #333333;
  width: 6.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/deep/.el-backtop {
  .iconfont {
    font-size: 3.75rem;
    color: #ff5e4e;
  }
}
</style>
